import { markRaw } from 'vue';
import { RouteRecordRaw } from 'vue-router';
import RouterTransition from '@/components/routerTransition.vue';

const routeName = 'goods';

const routes: Array<RouteRecordRaw> = [
    {
        path: '/goods',
        name: routeName,
        redirect: '/goods/list',
        component: markRaw(RouterTransition),
        meta: {
            title: 'yl.goodsMgt',
            icon: 'CreditCardOutlined',
        },
        children: [
            {
                path: 'list',
                name: `${routeName}-list`,
                meta: {
                    title: 'yl.goodsList',
                    icon: 'list-two',
                },
                component: () => import(/* webpackChunkName: "goods" */ '@/views/goods/list/index.vue'),
                // children: [
                //     {
                //         path: 'addgoods',
                //         // meta: {
                //         //     title: 'yl.issueQueue',
                //         //     icon: 'stack-light',
                //         // },
                //         component: () => import(/* webpackChunkName: "goods" */ '@/views/goods/addGoods/index.vue'),
                //     },
                // ],
            },
            {
                path: 'category',
                name: `${routeName}-category`,
                meta: {
                    title: 'yl.categoryMgt',
                    icon: 'category-management',
                },
                component: () => import(/* webpackChunkName: "goods" */ '@/views/goods/category/index.vue'),
            },
            {
                path: 'plan',
                name: `${routeName}-plan`,
                meta: {
                    title: 'yl.priceChangePlan',
                    icon: 'plan',
                },
                component: () => import(/* webpackChunkName: "goods" */ '@/views/goods/priceChangePlan/index.vue'),
            },
            // {
            //     path: 'issue',
            //     name: `${routeName}-issue`,
            //     meta: {
            //         title: 'yl.issueQueue',
            //         icon: 'stack-light',
            //     },
            //     component: () => import(/* webpackChunkName: "goods" */ '@/views/goods/issue/index.vue'),
            // },
        ],
    },
];

export default routes;
